package com.itheima.io.filereader.demo01;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class FileReaderDemo01 {

    public static void main(String[] args) throws IOException {

        FileReader fileReader = new FileReader("itheima-io-filereader\\a.txt");

//        int ch = -1;
//        while ((ch = fileReader.read()) != -1){
//            System.out.print((char)ch);
//        }

        char[] chars = new char[1024];
        int len = -1;
        while ((len = fileReader.read(chars)) != -1){
            System.out.println(new String(chars, 0, len));
        }

        fileReader.close();

    }

}
